<template>
  <div>
      <p v-for="i in data" :key="i.id">
        <router-link :to="'/xiangqinga?id='+i.id">{{i.name}} </router-link>
        {{i.uid}}
        <span v-if="i.read == true">已查看</span> 
        <span v-else style="class:blue">未查看</span> 
      </p>
  </div>
</template>

<script>
import axios from 'axios'
export default { 
    data() {
        return {
            data:[],
        }
    },
    created(){
        axios.post('http://127.0.0.1:8000/z/showgong/').then(resp=>{
            console.log(resp.data)
            this.data = resp.data
        })
    },
    methods:{
    }
}
</script>

<style>

</style>